
<!-- saved from url=(0026)/test.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>骡窝窝问答,解决旅行问题,基于旅游的问答分享平台 - 骡窝窝</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui,viewport-fit=cover">
    <meta name="format-detection" content="telephone=no,address=no">

    <link href="/css/mobile+css+head_mobile+css+ui^YVw^1526627473.css" rel="stylesheet" type="text/css">

    <link href="/css/new_ask2016.css" rel="stylesheet" type="text/css">
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="js/plugins/bootstrap-4.1.1-dist/css/bootstrap.min.css">
	<script src="/js/plugins/jquery/jquery.min.js"></script>
    <script src="/js/plugins/form/jquery.form.js"></script>
	<script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css" >
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="js/plugins/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <script>
        $(function () {
            //首先我们需要获取当前页的标签
            var currentInput = $('#currentPage');
            //因为我们手机滚动之前的数据就没有了,只有当前查出来的不合理
            var arr=[];
            var pages=1;
            function query() {
                //获取当前页
                var currentPage = currentInput.val();
                var keyword = $('#keyword').val();
                $.get("/questions",{currentPage:currentPage,keyword:keyword},function (data) {
                    //查询回显
                    $("#keyword").val(data.keyword);
                    pages=data.pageInfo.pages;
                    if(data.keyword){
                        $('._j_pager_box').renderValues(data.pageInfo,{
                            getHref:function (item,value) {
                                var href = $(item).data("href");
                                $(item).attr("href",href+value);
                            }
                        });
                        return;
                    }
                    //把两个数组的数据合并在一起,就可以滚动了
                    $.merge(arr,data.pageInfo.list);
                    var json = {list:arr};
                    $('._j_pager_box').renderValues(json,{
                        getHref:function (item,value) {
                            var href = $(item).data("href");
                            $(item).attr("href",href+value);
                        }
                    });
                });

                currentInput.val(parseInt(currentPage)+1);
            }
            query();
            $('._j_add_more_button').click(function () {
                var currentPage = currentInput.val();
                if(currentPage<=pages){
                    query();
                }else{
                    $(document).dialog({
                        type : 'notice',
                        infoText: '没有更多问题了!!!',
                        autoClose: 1000
                    });
                }
            })
            $('.search').click(function () {
                currentInput.val(1);
                query();
            })
        });
    </script>


</head>
<body>

<div class="search-head">
    <div class="row nav-search">
        <div class="col-2">
            <a href="index.html">
                <span><i class="fa fa-chevron-left fa-2x"></i></span>
            </a>
        </div>
    </div>
</div>
<form class="navbar-form navbar-left" role="search" action="/questions" method="get">
    <nav class="navbar navbar-light bg-light">
        <form class="form-inline">
            <input class="form-control mr-sm-2" type="search" placeholder="请输入标题" aria-label="Search" name="keyword" id="keyword" >
            <button class="btn btn-outline-warning my-2 my-sm-0 search" type="button"><i class="fa fa-search fa-lg"></i></button>
        </form>
    </nav>
</form>
<input type="hidden" id="currentPage" name="currentPage" value="1">
<section class="ans-list a-list">
    <ul class="_j_pager_box">
        <div render-loop="list">
            <li>
                <a data-href="/questionComment.html?id=" render-key="list.id" render-fun="getHref">
                    <h2 render-html="list.title"></h2>
                </a>
                <div class="clearfix">
                    <div class="user-img clearfix" data-uid="46376914">
                        <a data-href="/userProfiles.html?authorId=" render-key="list.user.id" render-fun="getHref">
                        <p>
                            <img render-src="list.user.headImgUrl">
                        </p>
                        <span render-html="list.user.nickName"></span>
                        </a>
                    </div>
                    <div class="ans-nr">
                        <a data-href="/questionComment.html?id=" render-key="list.id" render-fun="getHref">
                        <div class="clearfix">
                            <div class="pic"><img render-src="list.coverUrl">
                            </div>
                            <p render-html="list.content"></p>
                        </div>
                        </a>
                        <div class="clearfix">
                            <span><i class="fa fa-map-marker fa-lg"></i></span>
                            <span class="fl-l" render-html="list.place.name"></span>
                            <span class="fl-r"><b render-html="list.pageviews"></b>浏览<b
                                    render-html="list.counts"></b>回答</span>
                        </div>
                    </div>
                </div>
            </li>
        </div>
    </ul>
    <div style="margin-bottom: 65px;">
        <a class="more-list _j_add_more_button">更多问题</a>
    </div>
</section>

<section class="askfoot">
    <a href="/mine/ask.html" class="btn-que" ><i></i>
        我要提问
    </a>
</section>



</body></html>